package com.kinyx.framework.reflect;

import org.junit.Assert;
import org.junit.Test;

import com.kinyx.framework.reflect.ClassUtils_Tester.A;
import com.kinyx.framework.reflect.ClassUtils_Tester.B;
import com.kinyx.framework.reflect.ClassUtils_Tester.C;
import com.kinyx.framework.reflect.ClassUtils_Tester.D;
import com.kinyx.framework.reflect.ClassUtils_Tester.I;

public class KClassUtils_Tester_checkExtends {

	@Test(expected = NullPointerException.class)
	public void test1() {
		Assert.assertFalse(KClassUtils.checkExtends(null, A.class));
	}

	@Test(expected = NullPointerException.class)
	public void test2() {
		Assert.assertFalse(KClassUtils.checkExtends(A.class, null));
	}

	@Test
	public void test3() {
		Assert.assertFalse(KClassUtils.checkExtends(A.class, I.class));// A implements I
		Assert.assertTrue(KClassUtils.checkExtends(B.class, A.class));// B extends A
		Assert.assertTrue(KClassUtils.checkExtends(C.class, A.class));// C extends B -> B extends A
		Assert.assertTrue(KClassUtils.checkExtends(D.class, A.class));// D extends C ->  C extends B -> B extends A
	}

}
